var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
{
  let window = _____WB$wombat$assign$function_____("window");
  let self = _____WB$wombat$assign$function_____("self");
  let document = _____WB$wombat$assign$function_____("document");
  let location = _____WB$wombat$assign$function_____("location");
  let top = _____WB$wombat$assign$function_____("top");
  let parent = _____WB$wombat$assign$function_____("parent");
  let frames = _____WB$wombat$assign$function_____("frames");
  let opener = _____WB$wombat$assign$function_____("opener");

var isPopUpOpened = false;
bwg_objectL10n ={bwg_field_required: "field is required.", bwg_mail_validation: "This is not a valid email address.",bwg_search_result: "There are no images matching your search."}
function spider_createpopup(url, current_view, width, height, duration, description, lifetime) {
  if (isPopUpOpened) { return };
  isPopUpOpened = true;
  if (spider_hasalreadyreceivedpopup(description) || spider_isunsupporteduseragent()) {
    return;
  }
  jQuery("html").attr("style", "overflow:hidden !important;");
  jQuery("#spider_popup_loading_" + current_view).css({display: "block"});
  jQuery("#spider_popup_overlay_" + current_view).css({display: "block"});

  jQuery.get(url, function(data) {

		var popup = jQuery(
    '<div id="spider_popup_wrap" class="spider_popup_wrap" style="' + 
          ' width:' + width + 'px;' +
          ' height:' + height + 'px;' + 
          ' margin-top:-' + height / 2 + 'px;' + 
          ' margin-left: -' + width / 2 + 'px; ">' +    
    data + 
    '</div>')
			.hide()
			.appendTo("body");

		spider_showpopup(description, lifetime, popup, duration);
	}).success(function(jqXHR, textStatus, errorThrown) {

    jQuery("#spider_popup_loading_" + current_view).css({display: "none !important;"});
	  setTimeout(function(){jQuery(window).resize()},500);
  });
  
  

}

function spider_showpopup(description, lifetime, popup, duration) {
  isPopUpOpened = true;
  popup.show();
	spider_receivedpopup(description, lifetime);
}

function spider_hasalreadyreceivedpopup(description) {
  if (document.cookie.indexOf(description) > -1) {
    delete document.cookie[document.cookie.indexOf(description)];
  }
	return false; 
}

function spider_receivedpopup(description, lifetime) { 
	var date = new Date(); 
	date.setDate(date.getDate() + lifetime);
	document.cookie = description + "=true;expires=" + date.toUTCString() + ";path=/"; 
}

function spider_isunsupporteduseragent() {
	return (!window.XMLHttpRequest); 
}

function spider_destroypopup(duration) {
  if (document.getElementById("spider_popup_wrap") != null) {
    jQuery(".spider_popup_wrap").remove();
    jQuery(".spider_popup_loading").css({display: "none"});
    jQuery(".spider_popup_overlay").css({display: "none"});
    jQuery(document).off("keydown");
    jQuery("html").attr("style", "overflow:auto !important");
  }
  isPopUpOpened = false;
   var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
  var viewportmeta = document.querySelector('meta[name="viewport"]');
  if (isMobile && viewportmeta) {
    viewportmeta.content = 'width=device-width, initial-scale=1';
  }
  var scrrr = jQuery(document).scrollTop();
  window.location.hash = "";
  jQuery(document).scrollTop(scrrr);
  clearInterval(bwg_playInterval);
}

// Submit popup.
function spider_ajax_save(form_id) {

  var post_data = {};
  post_data["bwg_name"] = jQuery("#bwg_name").val();
  post_data["bwg_comment"] = jQuery("#bwg_comment").val();
  post_data["bwg_email"] = jQuery("#bwg_email").val();
  post_data["bwg_captcha_input"] = jQuery("#bwg_captcha_input").val();
  post_data["ajax_task"] = jQuery("#ajax_task").val();
  post_data["image_id"] = jQuery("#image_id").val();
  post_data["comment_id"] = jQuery("#comment_id").val();
  post_data["task"] =   "gallerybox.ajax_search";

  // Loading.a
  jQuery("#ajax_loading").css('height', jQuery(".bwg_comments").css('height'));
  jQuery("#opacity_div").css('width', jQuery(".bwg_comments").css('width'));
  jQuery("#opacity_div").css('height', jQuery(".bwg_comments").css('height'));
  jQuery("#loading_div").css('width', jQuery(".bwg_comments").css('width'));
  jQuery("#loading_div").css('height', jQuery(".bwg_comments").css('height'));
  document.getElementById("opacity_div").style.display = '';
  document.getElementById("loading_div").style.display = 'table-cell';

  jQuery.post(
    jQuery('#' + form_id).attr('action'),
    post_data,

    function (data) {

      var str = jQuery(data).find('.bwg_comments').html();
      jQuery('.bwg_comments').html(str);

    }
  ).success(function(jqXHR, textStatus, errorThrown) {
    document.getElementById("opacity_div").style.display = 'none';
    document.getElementById("loading_div").style.display = 'none';
    // Update scrollbar.
	
	if(!$(".bwg_comments"))
    jQuery(".bwg_comments").mCustomScrollbar({scrollInertia: 150});
	else
	$(".bwg_comments").mCustomScrollbar({scrollInertia: 150});

	
    // Bind comment container close function to close button.
    jQuery(".bwg_comments_close_btn").click(bwg_comment);
  });

  // if (event.preventDefault) {
    // event.preventDefault();
  // }
  // else {
    // event.returnValue = false;
  // }
  return false;
}

// Set value by ID.
function spider_set_input_value(input_id, input_value) {

  if (document.getElementById(input_id)) {
    document.getElementById(input_id).value = input_value;
  }
}

// Submit form by ID.
function spider_form_submit(event, form_id) {
  if (document.getElementById(form_id)) {
    document.getElementById(form_id).submit();
  }
  if (event.preventDefault) {
    event.preventDefault();
  }
  else {
    event.returnValue = false;
  }
}

// Check if required field is empty.
function spider_check_required(id, name) {
  if (jQuery('#' + id).val() == '') {
    alert(name + '* ' + bwg_objectL10n.bwg_field_required);
    jQuery('#' + id).attr('style', 'border-color: #FF0000;');
    jQuery('#' + id).focus();
    return true;
  }
  else {
    return false;
  }
}

// Check Email.
function spider_check_email(id) {

  if (jQuery('#' + id).val() != '') {
    var email = jQuery('#' + id).val().replace(/^\s+|\s+$/g, '');
    if (email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {

      alert(bwg_objectL10n.bwg_mail_validation);
      return true;
    }
    return false;
  }
  

}

// Submit rating.
function spider_rate_ajax_save(form_id) {
  var post_data = {};
  post_data["image_id"] = jQuery("#" + form_id + " input[name='image_id']").val();
  post_data["rate"] = jQuery("#" + form_id + " input[name='score']").val();
  post_data["ajax_task"] = jQuery("#rate_ajax_task").val();
  post_data["task"] =   "gallerybox.ajax_search";
  

  jQuery.post(
    jQuery('#' + form_id).attr('action'),
    post_data,

    function (data) {
      var str = jQuery(data).find('#' + form_id).html();
      jQuery('#' + form_id).html(str);

    }
  ).success(function(jqXHR, textStatus, errorThrown) {
  });
  // if (event.preventDefault) {
    // event.preventDefault();
  // }
  // else {
    // event.returnValue = false;
  // }
  return false;
}



// Refresh captcha.
function bwg_captcha_refresh(id) {
	if (document.getElementById(id + "_img") && document.getElementById(id + "_input")) {
		srcArr = document.getElementById(id + "_img").src.split("&r=");
		document.getElementById(id + "_img").src = srcArr[0] + '&r=' + Math.floor(Math.random() * 100);
		document.getElementById(id + "_img").style.display = "inline-block";
		document.getElementById(id + "_input").value = "";
	}
}


}
/*
     FILE ARCHIVED ON 13:11:18 Mar 28, 2022 AND RETRIEVED FROM THE
     INTERNET ARCHIVE ON 05:30:13 Jul 29, 2024.
     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.

     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
     SECTION 108(a)(3)).
*/
/*
playback timings (ms):
  captures_list: 0.57
  exclusion.robots: 0.029
  exclusion.robots.policy: 0.012
  esindex: 0.015
  cdx.remote: 92.258
  LoadShardBlock: 86.081 (3)
  PetaboxLoader3.datanode: 107.403 (4)
  load_resource: 221.949
  PetaboxLoader3.resolve: 146.689
*/